home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5712 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  62 lines

  1. Path: news.glink.net.hk!news
  2. From: ytchoi@glink.net.hk (╝vñl)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Trouble with "system" function in BC++ 3.0
  5. Date: 6 Feb 1996 14:22:26 GMT
  6. Organization: Anywhere .........
  7. Message-ID: <4f7o72$phg@unix2.glink.net.hk>
  8. References: <DMCG2B.LH0@isc.mew.co.jp>
  9. NNTP-Posting-Host: dialup122.glink.net.hk
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.6
  13.  
  14. In article <DMCG2B.LH0@isc.mew.co.jp>, tomio@ai.mew.co.jp says...
  15. >
  16. >I am trying to create a very simple .EXE file which will invoke a DOS
  17. >EXE command.  I am using the "system" function in BC++ 3.0.
  18. >
  19. >The problem I am having is that while my .cpp file compiles okay, the
  20. >linker returns an error.
  21. >
  22. >Here's the source (I added a call to the "swab" function just to
  23. >verify that my project can find the run time library):
  24. >------------------------------------------------------
  25. >#include <stdlib.h>
  26. >#include <stdio.h>
  27. >#include <string.h>
  28. >
  29. >char source[15] = "rFna koBlrna d";
  30. >char target[15];
  31. >
  32. >int main(void)
  33. >{
  34. >  printf("About to spawn command.com and run a DOS command\n");
  35. >  swab(source, target, strlen(source));
  36. >  printf("This is target: %s\n", target);
  37. >  system("dir");
  38. >  return 0;
  39. >}
  40. >
  41. >
  42. >Here's the warning/error messages:
  43. >----------------------------------
  44. >Compiling SYSTEST.CPP:
  45. >Linking SYSTEST.EXE:
  46. >Linker Warning: No module definition file specified: using defaults
  47. >Linker Error: Undefined symbol _system in module SYSTEST.CPP
  48. >
  49. >
  50. >The above code compiles and executes fine if I comment out the line
  51. >with "system" in it.
  52. >
  53. >If possible, please e-mail suggestions to me at:
  54. >tomio@ai.mew.co.jp
  55. >
  56. >Thanks all.
  57. >
  58. Are you programming in 16bit-Windows environment?  This function seems to be 
  59. not available in this environment.
  60.  
  61.  
  62.